import cache from "./utils/cache"
import { Navigate } from "react-router-dom"

export function Permission({ children }) {
    const token = cache.getCache("token")
    if (token) {
        return <>{children}</>
    } else {
        return <Navigate to={'/login'} replace/>
    }
}